import request from '@/utils/request'

// 标签-列表
export const getList = (data) => {
  return request({
    url: '/article/list',
    method: 'get',
    params: data
  })
}
// 标签-增
export const getAdd = (data) => {
  return request({
    url: '/article',
    method: 'post',
    data
  })
}
// 标签-删
export const getDelete = (id) => {
  return request({
    url: '/article',
    method: 'delete',
    data:id
  })
}
// 标签-改
export const getUpdate = (data) => {
  return request({
    url: '/article',
    method: 'put',
    data
  })
}
// 标签-详情
export const getDetail = (id) => {
  return request({
    url: '/article/'+id,
    method: 'get',
  })
}
// 获取首页信息
export const getIndex = () => {
  return request({
    url: '/article/index',
    method: 'get',
  })
}
// 获取CS毕设吧列表
export const getBlogList = (data) => {
  return request({
    url: BASE_API+'/article/list',
    method: 'get',
    params: data
  })
}
//站内搜索 
export const search = (data) => {
  return request({
    url: BASE_API+'/article/search?keywords='+data,
    method: 'get',
  })
}
//保存排序
export const saveSort = (data) => {
  return request({
    url: 'article/saveSort',
    method: 'post',
    data
  })
}
//更新验证码
export const codeEdit = (data) => {
  return request({
    url: 'article/setCode',
    method: 'get',
    params: data
  })
}
//获取验证码
export const codeGet = () => {
  return request({
    url: 'article/getCode',
    method: 'get',
  })
}
//搜索文章
export const getSearch = (data) => {
  return request({
    url: 'article/search',
    method: 'get',
    params: data
  })
}


export default { getList, getAdd, getDelete, getUpdate, getDetail, getIndex, saveSort, codeEdit, codeGet, getSearch }